
/*
Written by Seung Il Moon (simoon@networking.khu.ac.kr)
 * 2011.01.04
 */

package net.m2m.policyeditor.view;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;

public class PEmenuBar {
	private Menu menuBar;
	
	private MenuItem policy;
	private Menu policyMenu;
	private MenuItem policyAdd;
	private MenuItem policyEdit;
	private MenuItem policyDelete;
	
	private MenuItem myEvent;
	private Menu myeventMenu;
	private MenuItem myeventAdd;
	private MenuItem myeventEdit;
	private MenuItem myeventDelete;
	
	private MenuItem condition;
	private Menu conditionMenu;
	private MenuItem conditionAdd;
	private MenuItem conditionEdit;
	private MenuItem conditionDelete;
	
	private MenuItem action;
	private Menu actionMenu;
	private MenuItem actionAdd;
	private MenuItem actionEdit;
	private MenuItem actionDelete;
		
	private MenuItem M2MDevice;
	private Menu M2MDeviceMenu;
	private MenuItem deviceConfiguration;
	private MenuItem networkConfiguration;	
		
	private MenuItem M2MService;
	private Menu M2MServiceMenu;
	private MenuItem serviceArgument;
	private MenuItem addServiceArgument;
	private MenuItem deleteServiceArgument;
	
	private MenuItem Help;
	private Menu HelpMenu;
	private MenuItem HelpSub1;
	private MenuItem HelpSub2;	
		
	public void createMenuBar(Shell shell) {
		// create menu				
		menuBar = new Menu(shell, SWT.BAR | SWT.LEFT_TO_RIGHT);
		shell.setMenuBar(menuBar);
		
		// create Policy menu
		policy = new MenuItem(menuBar,SWT.CASCADE);
		policy.setText("Policy");
		policyMenu = new Menu(shell, SWT.DROP_DOWN);
		policy.setMenu(policyMenu);
		// create Policy sub menu
		policyAdd = new MenuItem(policyMenu, SWT.CASCADE);
		policyAdd.setText("Policy Add");
		policyEdit = new MenuItem(policyMenu, SWT.CASCADE);
		policyEdit.setText("Policy Edit");		
		policyDelete = new MenuItem(policyMenu, SWT.CASCADE);
		policyDelete.setText("Policy Delete");
		
		// create Evnet menu
		myEvent = new MenuItem(menuBar,SWT.CASCADE);
		myEvent.setText("Event");
		myeventMenu = new Menu(shell, SWT.DROP_DOWN);
		myEvent.setMenu(myeventMenu);
		// create Evnet sub menu
		myeventAdd = new MenuItem(myeventMenu, SWT.CASCADE);
		myeventAdd.setText("Event Add");
		myeventEdit = new MenuItem(myeventMenu, SWT.CASCADE);
		myeventEdit.setText("Event Edit");		
		myeventDelete = new MenuItem(myeventMenu, SWT.CASCADE);
		myeventDelete.setText("Event Delete");
		
		// create Condition menu
		condition = new MenuItem(menuBar,SWT.CASCADE);
		condition.setText("Condition");
		conditionMenu = new Menu(shell, SWT.DROP_DOWN);
		condition.setMenu(conditionMenu);
		// create Condition sub menu
		conditionAdd = new MenuItem(conditionMenu, SWT.CASCADE);
		conditionAdd.setText("Condition Add");
		conditionEdit = new MenuItem(conditionMenu, SWT.CASCADE);
		conditionEdit.setText("Condition Edit");		
		conditionDelete = new MenuItem(conditionMenu, SWT.CASCADE);
		conditionDelete.setText("Condition Delete");
		
		// create action menu
		action = new MenuItem(menuBar,SWT.CASCADE);
		action.setText("Action");
		actionMenu = new Menu(shell, SWT.DROP_DOWN);
		action.setMenu(actionMenu);
		// create action sub menu
		actionAdd = new MenuItem(actionMenu, SWT.CASCADE);
		actionAdd.setText("Action Add");
		actionEdit = new MenuItem(actionMenu, SWT.CASCADE);
		actionEdit.setText("Action Edit");		
		actionDelete = new MenuItem(actionMenu, SWT.CASCADE);
		actionDelete.setText("Action Delete");
				
		// create M2MDevice menu
		M2MDevice = new MenuItem(menuBar,SWT.CASCADE);
		M2MDevice.setText("M2MDevice");
		M2MDeviceMenu = new Menu(shell, SWT.DROP_DOWN);
		M2MDevice.setMenu(M2MDeviceMenu);
		// create M2MDevice sub menu
		deviceConfiguration = new MenuItem(M2MDeviceMenu, SWT.CASCADE);
		deviceConfiguration.setText("Device Configuration");
		networkConfiguration = new MenuItem(M2MDeviceMenu, SWT.CASCADE);
		networkConfiguration.setText("Network Configuration");
			
		// create M2MService menu
		M2MService = new MenuItem(menuBar,SWT.CASCADE);
		M2MService.setText("&M2MService");
		M2MServiceMenu = new Menu(shell, SWT.DROP_DOWN);
		M2MService.setMenu(M2MServiceMenu);
		// create M2MService sub menu
		serviceArgument = new MenuItem(M2MServiceMenu, SWT.CASCADE);
		serviceArgument.setText("Service Argument");
		addServiceArgument = new MenuItem(M2MServiceMenu, SWT.CASCADE);
		addServiceArgument.setText("Add Service Argument");
		deleteServiceArgument = new MenuItem(M2MServiceMenu, SWT.CASCADE);
		deleteServiceArgument.setText("Delete Service Argument");
		
		// create Help menu
		Help = new MenuItem(menuBar,SWT.CASCADE);
		Help.setText("&Help");
		HelpMenu = new Menu(shell, SWT.DROP_DOWN);
		Help.setMenu(HelpMenu);
		// create M2MService sub menu
		HelpSub1 = new MenuItem(HelpMenu, SWT.CASCADE);
		HelpSub1.setText("HelpSub1");
		HelpSub2 = new MenuItem(HelpMenu, SWT.CASCADE);
		HelpSub2.setText("HelpSub2");		
	}
}
